package facilius.controller.actionmanager;

import facilius.controller.ActionManager;
import facilius.controller.action.alunocurso.AlunoCursoCreateAction;
import facilius.controller.action.alunocurso.AlunoCursoDeleteAction;
import facilius.controller.action.alunocurso.AlunoCursoReadAction;
import facilius.controller.action.alunocurso.AlunoCursoShowFormAction;
import org.mentawai.authorization.Permission;
import org.mentawai.core.ActionConfig;
import org.mentawai.core.ApplicationManager;
import org.mentawai.core.Forward;
import org.mentawai.core.Redirect;
import org.mentawai.filter.AuthorizationFilter;

/**
 *
 * @author Graciano
 */
public class AlunoCursoActionManager implements ActionManager {

    public void loadActions(ApplicationManager appManager) {
        ActionConfig ac = null;
        ac = new ActionConfig("AlunoCursoRead", AlunoCursoReadAction.class);
        ac.addConsequence(appManager.SUCCESS, new Forward("jsp/alunoCurso/alunoCursoList.page"));
        ac.addConsequence(appManager.ERROR, new Forward("jsp/erro.page"));
        ac.addFilter(new AuthorizationFilter(new Permission("usuarioCurso")));
        appManager.addActionConfig(ac);

        ac = new ActionConfig("AlunoCursoShowForm", AlunoCursoShowFormAction.class);
        ac.addConsequence(appManager.SUCCESS, new Forward("jsp/alunoCurso/alunoCursoForm.page"));
        ac.addConsequence(appManager.ERROR, new Forward("jsp/erro.page"));
        ac.addFilter(new AuthorizationFilter(new Permission("usuarioCurso")));
        appManager.addActionConfig(ac);

        ac = new ActionConfig("AlunoCursoCreate", AlunoCursoCreateAction.class);
        ac.addConsequence(appManager.SUCCESS, new Redirect("AlunoCursoRead.mtw"));
        ac.addConsequence(appManager.ERROR, new Forward("jsp/erro.page"));
        ac.addFilter(new AuthorizationFilter(new Permission("usuarioCurso")));
        appManager.addActionConfig(ac);

        ac = new ActionConfig("AlunoCursoDelete", AlunoCursoDeleteAction.class);
        ac.addConsequence(appManager.SUCCESS, new Redirect("AlunoCursoRead.mtw"));
        ac.addConsequence(appManager.ERROR, new Forward("jsp/erro.page"));
        ac.addFilter(new AuthorizationFilter(new Permission("usuarioCurso")));
        appManager.addActionConfig(ac);

    }
}
